package com.itmg.analyze.jp.bean;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;

public class AnalyzeBean {

	public AnalyzeBean() {
	}
	
	/**
	 * 创建DOM对象，以解析xml文件
	 * @param strPath 配置文件的路径	 * @return 实例过的Document对象
	 * */
	public static Document parseDocument(String URL)
	{
		Document theDocument = null;
		try
		{
			DocumentBuilderFactory theDocumentBuilderFactory = DocumentBuilderFactory.newInstance();
			DocumentBuilder theDocumentBuilder = theDocumentBuilderFactory.newDocumentBuilder();
			theDocument = theDocumentBuilder.parse(URL);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		return theDocument;
	}
}
